import request from '@/utils/request'
const api_name = "/course"
export default {
    getList(page, limit, searchObj) {
        // 分页查询课程列表
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: "post",
            data: searchObj
        })
    },
    // 删除课程API
    deleteCourseBuid(id) {
        return request({
            url: `${api_name}/${id}`,
            method: "delete",
        })
    },
    // 添加课程基本信息
    addCourse(course) {
        return request({
            url: `${api_name}`,
            method: "post",
            data: course
        })
    },
    // 根据id获取课程基本信息
    getCourseInfoByid(id) {
        return request({
            url: `${api_name}/${id}`,
            method: "get",
        })
    },
    // 更新课程基本信息
    updateCourse(course) {
        return request({
            url: `${api_name}/${course.id}`,
            method: "put",
            data: course
        })
    }
}